<template>
	<div id="adm5">
		<el-table :data="user" border style="width: 75%">
		<el-table-column prop="id" label="编号"></el-table-column>
		<el-table-column prop="nickname" label="用户名称"></el-table-column>
		<el-table-column prop="phone" label="电话"></el-table-column>
		<el-table-column prop="account" label="账号"></el-table-column>
		<el-table-column label="图片" v-slot="scope">
			<el-image :src="`${$Imgurl}/api/public/showImg/${scope.row.img}`" />
		</el-table-column>
		<el-table-column label="操作">
			<template #default="scope">
				<el-button @click="fezze(scope.row.id)">冻结</el-button>
				<el-button @click="again(scope.row.id)">密码重置</el-button>
			</template>
		</el-table-column>	
	  </el-table>
	</div>
</template>

<script>
	export default {
		name: 'Adm5',
		props: [],
		data() {
			return {
				user : []
			}
		},
		created(){
			this.axios.get('/api/adm/user/findAll').then((res)=>{
				this.user=res.data.data.users
				console.log(this.user)
			}).catch((error)=>{
				console.log(error)
			})
		},
		methods: {
			fezze(id){
				this.axios.get('/api/adm/user/close/'+id).then((res)=>{
					alert(res.data.msg)
				}).catch((error)=>{
					console.log(error)
				})
			},
			again(id){
				this.axios.get('/api/adm/user/resetPwd/'+id).then((res)=>{
					alert(res.data.msg)
				}).catch((error)=>{
					console.log(error)
				})
			}
		}
	}
</script>

<style scoped>

</style>
